#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cstring>
#define endl "\n"
using namespace std;
int main()
{
	string s;
	int k = 0;
	cin >> s;
	for (int i = 0; i < 8; i++)
	{
		if (s[i] == '1')
			k++;
	}
	cout << k << endl;
	return 0;
}